package route

import (
	"net/http"
	"ubt-aio-service/app/ctrl/comm_ctrl"
	"ubt-aio-service/app/ctrl/exam_ctrl"
	"ubt-aio-service/app/ctrl/goods_ctrl"
	"ubt-aio-service/app/ctrl/info_ctrl"
	"ubt-aio-service/app/ctrl/sys_ctrl"
)

func Routes() map[RouteItem]func(r *http.Request, w http.ResponseWriter) {
	var routes = make(map[RouteItem]func(r *http.Request, w http.ResponseWriter))
	// 一些通用的接口
	routes[RouteItem{Method: "GET", Path: "/common/num-code"}] = comm_ctrl.CommCtrl.NumCode
	routes[RouteItem{Method: "GET", Path: "/common/areas"}] = comm_ctrl.CommCtrl.Areas
	routes[RouteItem{Method: "POST", Path: "/common/upload"}] = comm_ctrl.CommCtrl.Upload
	routes[RouteItem{Method: "POST", Path: "/common/delete"}] = comm_ctrl.CommCtrl.Delete
	routes[RouteItem{Method: "POST", Path: "/common/download"}] = comm_ctrl.CommCtrl.Download
	// 系统配置
	routes[RouteItem{Method: "POST", Path: "/system/config/save"}] = sys_ctrl.SysConfCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/config/process"}] = sys_ctrl.SysConfCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/system/config/one"}] = sys_ctrl.SysConfCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/config/page"}] = sys_ctrl.SysConfCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/config/select"}] = sys_ctrl.SysConfCtrl.Select
	// 菜单
	routes[RouteItem{Method: "POST", Path: "/system/menu/save"}] = sys_ctrl.SysMenuCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/menu/deletes"}] = sys_ctrl.SysMenuCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/menu/one"}] = sys_ctrl.SysMenuCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/menu/list"}] = sys_ctrl.SysMenuCtrl.List
	routes[RouteItem{Method: "GET", Path: "/system/menu/select"}] = sys_ctrl.SysMenuCtrl.Select
	routes[RouteItem{Method: "GET", Path: "/system/menu/tree"}] = sys_ctrl.SysMenuCtrl.Tree
	routes[RouteItem{Method: "GET", Path: "/system/menu/sort"}] = sys_ctrl.SysMenuCtrl.Sort
	routes[RouteItem{Method: "GET", Path: "/system/menu/menu"}] = sys_ctrl.SysMenuCtrl.Menu
	// 按钮
	routes[RouteItem{Method: "POST", Path: "/system/button/save"}] = sys_ctrl.SysBtnCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/button/deletes"}] = sys_ctrl.SysBtnCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/button/one"}] = sys_ctrl.SysBtnCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/button/page"}] = sys_ctrl.SysBtnCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/button/sort"}] = sys_ctrl.SysBtnCtrl.Sort
	// 角色
	routes[RouteItem{Method: "POST", Path: "/system/role/save"}] = sys_ctrl.SysRoleCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/role/deletes"}] = sys_ctrl.SysRoleCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/role/one"}] = sys_ctrl.SysRoleCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/role/page"}] = sys_ctrl.SysRoleCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/role/select"}] = sys_ctrl.SysRoleCtrl.Select
	// 用户
	routes[RouteItem{Method: "POST", Path: "/system/user/login"}] = sys_ctrl.SysUserCtrl.Login
	routes[RouteItem{Method: "GET", Path: "/system/user/session"}] = sys_ctrl.SysUserCtrl.Session
	routes[RouteItem{Method: "POST", Path: "/system/user/exit"}] = sys_ctrl.SysUserCtrl.Exit
	routes[RouteItem{Method: "POST", Path: "/system/user/save"}] = sys_ctrl.SysUserCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/user/process"}] = sys_ctrl.SysUserCtrl.Process
	routes[RouteItem{Method: "POST", Path: "/system/user/personal"}] = sys_ctrl.SysUserCtrl.Mine
	routes[RouteItem{Method: "GET", Path: "/system/user/one"}] = sys_ctrl.SysUserCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/user/page"}] = sys_ctrl.SysUserCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/user/select"}] = sys_ctrl.SysUserCtrl.Select
	// 数据字典
	routes[RouteItem{Method: "POST", Path: "/system/dict/save"}] = sys_ctrl.SysDictCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/dict/deletes"}] = sys_ctrl.SysDictCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/dict/one"}] = sys_ctrl.SysDictCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/dict/list"}] = sys_ctrl.SysDictCtrl.List
	routes[RouteItem{Method: "GET", Path: "/system/dict/tree"}] = sys_ctrl.SysDictCtrl.Tree
	routes[RouteItem{Method: "GET", Path: "/system/dict/sort"}] = sys_ctrl.SysDictCtrl.Sort
	routes[RouteItem{Method: "GET", Path: "/system/dict/select"}] = sys_ctrl.SysDictCtrl.Select
	routes[RouteItem{Method: "GET", Path: "/system/dict/sel-dept"}] = sys_ctrl.SysDictCtrl.SelDepts
	// 标签
	routes[RouteItem{Method: "POST", Path: "/system/tag/save"}] = sys_ctrl.SysTagCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/tag/deletes"}] = sys_ctrl.SysTagCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/tag/page"}] = sys_ctrl.SysTagCtrl.Page
	routes[RouteItem{Method: "POST", Path: "/system/tag/add"}] = sys_ctrl.SysTagCtrl.Add
	routes[RouteItem{Method: "POST", Path: "/system/tag/delete"}] = sys_ctrl.SysTagCtrl.Delete
	// 文件
	routes[RouteItem{Method: "POST", Path: "/system/file/upload"}] = sys_ctrl.SysFileCtrl.Upload
	routes[RouteItem{Method: "POST", Path: "/system/file/img"}] = sys_ctrl.SysFileCtrl.UpImg4We
	routes[RouteItem{Method: "POST", Path: "/system/file/media"}] = sys_ctrl.SysFileCtrl.Upvd4We
	routes[RouteItem{Method: "POST", Path: "/system/file/deletes"}] = sys_ctrl.SysFileCtrl.Deletes
	routes[RouteItem{Method: "POST", Path: "/system/file/download"}] = sys_ctrl.SysFileCtrl.Download
	routes[RouteItem{Method: "POST", Path: "/system/file/upd-name"}] = sys_ctrl.SysFileCtrl.UpdName
	routes[RouteItem{Method: "POST", Path: "/system/file/upd-type"}] = sys_ctrl.SysFileCtrl.UpdType
	routes[RouteItem{Method: "GET", Path: "/system/file/one"}] = sys_ctrl.SysFileCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/file/page"}] = sys_ctrl.SysFileCtrl.Page
	// 消息
	routes[RouteItem{Method: "POST", Path: "/system/notice/process"}] = sys_ctrl.SysNoteCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/system/notice/one"}] = sys_ctrl.SysNoteCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/notice/page"}] = sys_ctrl.SysNoteCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/notice/new"}] = sys_ctrl.SysNoteCtrl.New
	routes[RouteItem{Method: "POST", Path: "/system/notice/read"}] = sys_ctrl.SysNoteCtrl.Read
	// 日志
	routes[RouteItem{Method: "GET", Path: "/system/log/page"}] = sys_ctrl.SysLogCtrl.Page
	// 意见反馈
	routes[RouteItem{Method: "POST", Path: "/system/feedback/save"}] = sys_ctrl.FeedbackCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/system/feedback/process"}] = sys_ctrl.FeedbackCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/system/feedback/one"}] = sys_ctrl.FeedbackCtrl.One
	routes[RouteItem{Method: "GET", Path: "/system/feedback/page"}] = sys_ctrl.FeedbackCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/system/feedback/replied"}] = sys_ctrl.FeedbackCtrl.Replied
	// 资讯
	routes[RouteItem{Method: "POST", Path: "/infor/save"}] = info_ctrl.InfoCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/infor/process"}] = info_ctrl.InfoCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/infor/one"}] = info_ctrl.InfoCtrl.One
	routes[RouteItem{Method: "GET", Path: "/infor/page"}] = info_ctrl.InfoCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/infor/sort"}] = info_ctrl.InfoCtrl.Sort
	// 关键字
	routes[RouteItem{Method: "POST", Path: "/infor/keyword/save"}] = info_ctrl.KeywordCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/infor/keyword/process"}] = info_ctrl.KeywordCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/infor/keyword/one"}] = info_ctrl.KeywordCtrl.One
	routes[RouteItem{Method: "GET", Path: "/infor/keyword/page"}] = info_ctrl.KeywordCtrl.Page
	// 试卷题库
	routes[RouteItem{Method: "POST", Path: "/exam/base/save"}] = exam_ctrl.QstCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/exam/base/deletes"}] = exam_ctrl.QstCtrl.Deletes
	routes[RouteItem{Method: "GET", Path: "/exam/base/one"}] = exam_ctrl.QstCtrl.One
	routes[RouteItem{Method: "GET", Path: "/exam/base/page"}] = exam_ctrl.QstCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/exam/base/sort"}] = exam_ctrl.QstCtrl.Sort
	// 试卷
	routes[RouteItem{Method: "POST", Path: "/exam/save"}] = exam_ctrl.ExamCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/exam/process"}] = exam_ctrl.ExamCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/exam/one"}] = exam_ctrl.ExamCtrl.One
	routes[RouteItem{Method: "GET", Path: "/exam/page"}] = exam_ctrl.ExamCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/exam/select"}] = exam_ctrl.ExamCtrl.Select
	// 考试
	routes[RouteItem{Method: "GET", Path: "/exam/log/oneExam"}] = exam_ctrl.ExamLogCtrl.OneExam
	routes[RouteItem{Method: "GET", Path: "/exam/log/quests"}] = exam_ctrl.ExamLogCtrl.ListQsts
	routes[RouteItem{Method: "GET", Path: "/exam/log/page"}] = exam_ctrl.ExamLogCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/exam/log/one"}] = exam_ctrl.ExamLogCtrl.One
	routes[RouteItem{Method: "POST", Path: "/exam/log/test"}] = exam_ctrl.ExamLogCtrl.TestExam
	routes[RouteItem{Method: "POST", Path: "/exam/log/tested"}] = exam_ctrl.ExamLogCtrl.HasTested
	routes[RouteItem{Method: "GET", Path: "/exam/log/detail"}] = exam_ctrl.ExamLogCtrl.UserDetail
	routes[RouteItem{Method: "POST", Path: "/exam/log/export"}] = exam_ctrl.ExamLogCtrl.Export
	routes[RouteItem{Method: "POST", Path: "/exam/log/exp-ls"}] = exam_ctrl.ExamLogCtrl.ExportLs
	// 商品品牌
	routes[RouteItem{Method: "POST", Path: "/goods/brand/save"}] = goods_ctrl.BrandCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/goods/brand/process"}] = goods_ctrl.BrandCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/goods/brand/one"}] = goods_ctrl.BrandCtrl.One
	routes[RouteItem{Method: "GET", Path: "/goods/brand/page"}] = goods_ctrl.BrandCtrl.Page
	routes[RouteItem{Method: "GET", Path: "/goods/brand/sort"}] = goods_ctrl.BrandCtrl.Sort
	routes[RouteItem{Method: "GET", Path: "/goods/brand/select"}] = goods_ctrl.BrandCtrl.Select
	routes[RouteItem{Method: "GET", Path: "/goods/brand/list"}] = goods_ctrl.BrandCtrl.List
	// 商品分类
	routes[RouteItem{Method: "POST", Path: "/goods/type/save"}] = goods_ctrl.TypeCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/goods/type/process"}] = goods_ctrl.TypeCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/goods/type/one"}] = goods_ctrl.TypeCtrl.One
	routes[RouteItem{Method: "GET", Path: "/goods/type/list"}] = goods_ctrl.TypeCtrl.List
	routes[RouteItem{Method: "GET", Path: "/goods/type/tree"}] = goods_ctrl.TypeCtrl.Tree
	routes[RouteItem{Method: "GET", Path: "/goods/type/sort"}] = goods_ctrl.TypeCtrl.Sort
	routes[RouteItem{Method: "GET", Path: "/goods/type/select"}] = goods_ctrl.TypeCtrl.Select
	// 商品
	routes[RouteItem{Method: "POST", Path: "/goods/spu/save"}] = goods_ctrl.SpuCtrl.Save
	routes[RouteItem{Method: "POST", Path: "/goods/spu/process"}] = goods_ctrl.SpuCtrl.Process
	routes[RouteItem{Method: "GET", Path: "/goods/spu/one"}] = goods_ctrl.SpuCtrl.One
	routes[RouteItem{Method: "GET", Path: "/goods/spu/page"}] = goods_ctrl.SpuCtrl.Page

	return routes
}
